Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-54

add option to FileAppender to auto-create parent directories

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • None
    • logback-core
    • None
    • Operating System: Linux
      Platform: PC

    • 137

    Description

      FileAppender should be able to automatically create parent directories as needed when writing the log file.

      For instance, if configured with <File>/var/tmp/project_name/some_file.log</File>, and the new option set to true (suggest <CreateParentDirectories>true</CreateParentDirectories> maybe), then in FileAppender.setFile(), it should do

      new File( fileName ).getParentFile().mkdirs()

      workaround is to create the directory before initializing logback. Possible but far less than ideal, and rather complicated too

      Attachments

        Activity

          People

            logback-dev Logback dev list
            bruno.navert Bruno Navert
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: